<template>
	<view>
		<view class="top-user flex align-center" @tap="goLogin">
			<view class="left">
				<view class="headimg">
					<!-- #ifdef MP-WEIXIN -->
					<open-data type="userAvatarUrl" v-if="avatar == ''"></open-data>
					<image class="headimg" v-else :src="avatar?avatar:'/static/images/member/default_headimg.jpg'"></image>
					<!-- #endif -->
					<!-- #ifndef MP-WEIXIN -->
					<image class="headimg" :src="avatar?avatar:'/static/images/member/default_headimg.jpg'"></image>
					<!-- #endif -->
				</view>
			</view>
			<view class="right" v-if="uid > 0">
				<view class="nickname">
					<!-- #ifdef MP-WEIXIN -->
					<open-data type="userNickName" v-if="nickname == ''" ></open-data>
					<text v-else>{{nickname}}</text>
					<!-- #endif -->
					<!-- #ifndef MP-WEIXIN -->
					{{nickname}}
					<!-- #endif -->
				</view>
				<view class="user_id">
					<text >UID：{{uid}}</text>
					<text class="copy" @tap="uidCopy">复制</text>
					<button class="cu-btn author-btn"  @tap="getApiUserinfo" v-if="uid > 0">更换头像和昵称</button>
				</view>
			</view>
			<view class="login-tip" v-if="uid < 1">请登录</view>
		</view>
		<view class="content">
			<view class="ul">
				<view class="li flex align-center" >
					<image class="image" src="/static/images/member/tuijian.png"></image>
					<button class="button" open-type="share" hover-class="none" :plain="true" >推荐给其他人</button>
					<text class="iconfont icon-youjiantou"></text>
				</view>
				<view class="li flex align-center" >
					<image class="image" src="/static/images/member/kefu.png"></image>
					<button class="button" open-type="contact" hover-class="none" :plain="true" >人工客服</button>
					<text class="iconfont icon-youjiantou"></text>
				</view>
				<view class="li flex align-center" @tap="openUrl('statistics-list')" v-if="is_super_admin == 1"> 
					<image class="image" src="/static/images/member/shezhi.png"></image>
					<button class="button"  hover-class="none" :plain="true" >全部统计列表</button>
					<text class="iconfont icon-youjiantou"></text>
				</view>
			</view>
		</view>
		<wechat-login ref="wechat_login" :hideTabbar="true" @callback="wechatRegister"></wechat-login>
	</view>
</template>

<script src="./member.js"></script>

<style lang="scss">
	.author-btn {
		width: 210rpx;
		height: 50rpx;
		background: #ffffff !important;
		border-radius: 40rpx;
		font-size: 24rpx;
		color: $uni-btn-color;
		padding: 0 !important;
	}
	.content{
		    background: #ffffff;
			margin: 20rpx 3% 20rpx 3%;
			border-radius: 20rpx;
			padding: 10rpx 20rpx 0rpx 20rpx;
			width: 94%;
			.ul{
				.li{
					height: 90rpx;
					display: flex;
					padding: 10rpx 20rpx;
					position: relative;
					border-bottom: 2rpx solid #eee;
					.image{
						position: absolute;
						width: 40rpx;
						height: 40rpx;
						left: 8rpx;
						top: 24rpx;
					}
					.button{
						width: 100%;
						border: none;
						text-align: left;
						font-size: 28rpx;
						padding-left: 46rpx;
					}
					.iconfont{
						position: absolute;
						right:10rpx;
						color: #A0A0A0;
					}
				}
				.li:last-child{
					border-bottom:none;
				}
			}
	}
	.top-user{
		height: 200rpx;
		background: #ffffff;
		margin: 20rpx 3% 20rpx 3%;
		border-radius: 20rpx;
		padding: 20rpx;
		width: 94%;
		.login-tip{
			font-size: 34rpx;
			margin-left: 20rpx;
			letter-spacing: 2rpx;
			color: #333333;
		}
		.right{
			height:100%;
			.nickname{
				font-size: 30rpx;
				height: 96rpx;
				line-height: 120rpx;
				overflow: hidden;
			}
			.user_id{
				font-size: 24rpx;
				color: #A0A0A0;
				.copy{
					color: #6794CC;
					margin-left: 20rpx;
				}
			}
		}
		.left{
			.headimg{
				 overflow:hidden;  
				  display: block;  
				  margin: 0rpx;   
				  margin-right: 10rpx;
				  border-radius: 50%;  
				  border: 2rpx solid #fff;  
				width: 120rpx;
				height: 120rpx;
			}
		}
	}
	
</style>
